﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="XuatKho.aspx.cs" Inherits="XuaNhapKho.XuatKho" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="breadLine">
        <ul class="breadcrumb">
            <li><a href="#">Hệ thống quản lý xuất nhập kho</a> <span class="divider">></span></li>
            <li class="active">Xuất kho</li>
        </ul>
    </div>
    <div class="workplace">
        <div class="row-fluid">
            <div class="span12">
                <div class="head">
                    <div class="isw-grid">
                    </div>
                    <h1>
                        Thông tin xuất kho</h1>
                    <div class="clear">
                    </div>
                </div>
                <div class="block-fluid">
                    <div class="row-form">
                        <div class="span6">
                            <div class="span3">
                                Ngày nhập:</div>
                            <div class="span9">
                                <asp:TextBox  style="width : 196px;" ID="txtNgayNhap" placeholder="ngày nhập..." runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="span6">
                            <div class="span3">
                                Khách hàng:</div>
                            <div class="span9">
                               <asp:TextBox ID="txtKhachHang" placeholder="thông tin khách hàng..." runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                 
                    <div class="row-form">
                        <div class="span6">
                            <div class="span3">
                                Mã sản phẩm:</div>
                            <div class="span9">
                                <asp:TextBox ID="txtMaSanPham" style="width : 150px;height : 30px;" placeholder="mã sản phẩm..."  runat="server"></asp:TextBox>
                                <asp:DropDownList style="width : 200px;" ID="ddlNhomSanPham" runat="server">
                                </asp:DropDownList>
                                
                                </div>
                        </div>
                        <div class="span6">
                            <div class="span3">
                                Tên sản phẩm:</div>
                            <div class="span9">
                                <asp:TextBox ID="txtTenSanPham"  placeholder="tên sản phẩm..."  runat="server"></asp:TextBox></div>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span6">
                           <div class="span3">
                                Số lượng:</div>
                            <div class="span9" >
                              
                                <asp:TextBox ID="txtSoLuong" Text="1" style="width : 100px;height : 30px;" placeholder="số lượng..."  runat="server"></asp:TextBox>
                                <asp:DropDownList ID="ddlDonVi" style="width : 100px;" runat="server">
                                </asp:DropDownList>
                                <span id="soluongTrongKho"></span>
                                </div>
                        </div>
                        <div class="span6">
                            <div class="span3">
                                Đơn giá:</div>
                            <div class="span9">
                                <asp:TextBox ID="txtGiaSanPham" Text="1" style="width : 150px;" placeholder="đơn giá sản phẩm..."  runat="server"></asp:TextBox>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VAT: &nbsp;&nbsp;&nbsp;<asp:TextBox ID="txtVAT" Text="0" style="width : 150px;" placeholder="vat..."  runat="server"></asp:TextBox> &nbsp;%   
                            </div>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span6">
                            <div class="span3">
                                 Ghi chú:</div>
                            <div class="span9">
                                <asp:TextBox ID="txtGhiChu" TextMode="MultiLine" placeholder="ghi chú..."  runat="server"></asp:TextBox>
                               </div>
                        </div>
                        <div class="span6">
                            <div class="span6">
                             Nhân viên: <b>
                               <asp:Literal ID="ltlTenNhanVien" runat="server"></asp:Literal></b>
                           <br />
                           Địa chỉ: <b><asp:Literal ID="ltlDiaChi" runat="server"></asp:Literal></b>
                           <br />
                           Số điện thoại: <b><asp:Literal ID="ltlSoDienThoai" runat="server"></asp:Literal></b>
                           <br />
                           <b>Thanh toán:</b>

                                </div>
                            <div class="span6">
                                
                                  Số lượng hàng: <b>
                                <asp:Literal ID="ltlCount" runat="server"></asp:Literal></b>  <br />VAT: <b>
                                    <asp:Literal ID="ltlTotalVat" runat="server"></asp:Literal> VND</b> <br /> Tổng tiền: <b>
                                        <asp:Literal ID="ltlTotalMoney" runat="server"></asp:Literal> VND</b>
                                        <asp:TextBox ID="txtThanhToan" placeholder="tổng tiền thanh toán..." runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span3">
                        </div>
                        <div class="span6">
                            <asp:Button class="btn" ID="btnAdd" Height="30px" runat="server" 
                                Text="Cập nhập" onclick="btnAdd_Click" />
                            <asp:Button class="btn" ID="btnDelete" 
                                OnClientClick="return confirm('Bạn có thực sự muốn xóa không ?')" Height="30px" runat="server" 
                                Text="Xóa tất cả" onclick="btnDelete_Click"  />
                            <asp:Button class="btn" ID="btnPrint" Height="30px"  runat="server" 
                                Text="In phiếu" onclick="btnPrint_Click" />
                            <asp:Button class="btn" ID="btnSave" Height="30px"  runat="server" 
                                Text="Lưu kho" onclick="btnSave_Click" />
                            
                        </div>
                        <div class="span3">
                       
                        </div>
                        <div class="clear">
                        </div>
                    </div>

                    
                </div>
            </div>
        </div>
        <div class="row-fluid">
            <div class="span12">
                <div class="head">
                    <div class="isw-grid">
                    </div>
                    <h1>
                        Danh sách nhập kho</h1>
                    <div class="clear">
                    </div>
                </div>
                <div class="block-fluid">
                    <asp:GridView ID="grvNhapKho"  BorderStyle="None" GridLines="None"  CssClass="table" runat="server" AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="NgayNhap" HeaderText="Ngày xuất" />
                            <asp:BoundField DataField="TenKhachHang" HeaderText="Tên khách hàng" />
                            <asp:BoundField DataField="MaSanPham" HeaderText="Mã hàng" />
                            <asp:BoundField DataField="TenNhomSanPham" HeaderText="Nhóm sản phẩm" />
                            <asp:BoundField DataField="TenDonVi" HeaderText="Đơn vị tính" />
                            <asp:BoundField DataField="SoLuong" HeaderText="Số lượng" />
                            <asp:TemplateField HeaderText="Đơn giá">
                                
                                <ItemTemplate>
                                    <%# String.Format("{0:0,0}",Double.Parse(Eval("GiaSanPham").ToString()))  %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Thành tiền">
                                <ItemTemplate>
                                    <%# String.Format("{0:0,0}", Double.Parse(Eval("TongTien").ToString()))%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="VAT" HeaderText="VAT(%)" />
                            <asp:BoundField DataField="GhiChu" HeaderText="Ghi chú" />
                            <asp:TemplateField HeaderText="Hành động">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtnUpdate" runat="server" 
                                        CommandArgument='<%# Eval("MaSanPham") %>' oncommand="lbtnUpdate_Command">Cập nhập</asp:LinkButton>
                                    &nbsp;|
                                    <asp:LinkButton ID="lbtnRemove" runat="server" 
                                        CommandArgument='<%# Eval("MaSanPham") %>' oncommand="lbtnRemove_Command">Xóa</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
